	<title>权限菜单管理</title>
	<style>
		#info-box{ display: none !important;}
		#open-box #info-box{ display: block !important;}
	</style>
	<link rel="stylesheet" type="text/css" href="__STATIC__/js/layui256/layui/css/layui.css">
</head>
<body>
	<div class="layui-tab">
		<ul class="layui-tab-title">
			<?php $currentTab = 1;?>
			<include file="rbac_menu/public/nav">
		</ul>
		<div class="layui-col-md12">
			<div class="layui-card">
				<div class="layui-card-header">
				</div>
				<div class="layui-card-body">
					<div id="rbac-tree"></div>
				</div>
			</div>
		</div>
	</div>

<script src="__STATIC__/js/jquery.js"></script>
<script src="__STATIC__/js/layui256/layui/layui.all.js"></script>
<script>

;!function(){
	var data = {$list};
	var layer = layui.layer,tree = layui.tree;
	var form = layui.form;
	var indexTree = tree.render({
		elem: "#rbac-tree",
		data:data,
		onlyIconControl:true,
	});

$(document).on( 'click' , '.btn-user-count' , function(e){
	e.stopPropagation();
	let roleId = $(this).parents('.layui-tree-set').data('id');
	layer.open({
		offset:'100px;',
		title:'角色成员',
		type: 2,
		area: ['700px', '450px'],
		btn:['关闭'],
		fixed: false, //不固定
		maxmin: true,
		content: '{:url("authorization/RbacMenu/userList")}?roleId='+roleId
	});
	return false;
} );

$(document).on( 'click' , '.btn-quanxian' , function(e){
	e.stopPropagation();
	let roleId = $(this).parents('.layui-tree-set').data('id');
	console.log( roleId );
	layer.open({
		offset:'100px;',
		title:'角色菜单授权',
		type: 2,
		btn:['保存','关闭'],
		area: ['700px', '80%'],
		fixed: false, //不固定
		maxmin: true,
		scrollbar: false,  //弹窗时禁止父级页面滚动
		content: '{:url("authorization/RbacMenu/setRoleAuth")}?roleId='+roleId,
		yes:function( index , layero ){
			var res = $(layero).find("iframe")[0].contentWindow.getChecked( index , roleId );
			/*$.post( '{:url("authorization/RbacMenu/setRoleAuthPost")}', { roleId:roleId , list:res } , function( data ){
				//data = JSON.parse( data );
				let icon = ( data.code == 200 )? 1 : 5;
				layer.close(index);
				layer.msg( data.message , { anim:5,time:0, icon:icon } ,function(){
					//if(icon ==1 ) window.location.reload(); 
				} );
			} , 'json' );*/
		}
	});
	return false;
} );


}();
</script>
</body>
</html>